package com.sunni.utils;

import javax.servlet.http.HttpServletRequest;


/*课时111-通过request, 存ip、取ip*/
public class RequestUtil {

    public static ThreadLocal<HttpServletRequest> local = new ThreadLocal();

    /*取出 ip*/
    public static HttpServletRequest getRequest(){
        return local.get();
    }

    /*存入 ip*/
    public  static  void setRequest(HttpServletRequest request){
        local.set(request);
    }

}
